package com.atzxh.exer;

/**
 * @author 小红同学
 * @date 2023-05-09-21:36
 * @description
 */
public class AnimalTest {
    public static void main(String[] args) {
        Animal cat = new Cat("Tom", 2);
        Animal dog = new Dog("Jack", 3);

        System.out.println(cat.getName() + "今年" + cat.getAge() + "岁了，它在吃饭:");
        cat.eat();

        System.out.println(dog.getName() + "今年" + dog.getAge() + "岁了，它在吃饭:");
        dog.eat();
    }
}
